import { ChangeDetectionStrategy, Component } from '@angular/core';
import { LvCalendarEvents } from '@iux/live';

const DATE = new Date();
const YEAR = DATE.getFullYear();
const MONTH = DATE.getMonth();
const PRE_MONTH = DATE.getMonth() - 1;
const NEXT_MONTH = DATE.getMonth() + 1;

const Events: LvCalendarEvents[] = [
  {
    id: 1,
    title: '江苏紫金银行客户满意活动1',
    startDate: new Date(YEAR, MONTH, 1),
    endDate: new Date(YEAR, MONTH, 2),
  },
  {
    id: 2,
    title: '江苏紫金银行客户满意活动2',
    startDate: new Date(YEAR, MONTH, 1),
  },
  {
    id: 3,
    title: '江苏紫金银行客户满意活动3',
    startDate: new Date(YEAR, MONTH, 2),
    endDate: new Date(YEAR, MONTH, 3),
  },
  {
    id: 4,
    title: '江苏紫金银行客户满意活动4',
    startDate: new Date(YEAR, MONTH, 10),
    endDate: new Date(YEAR, MONTH, 15),
  },
  {
    id: 5,
    title: '江苏紫金银行客户满意活动5',
    startDate: new Date(YEAR, MONTH, 5),
    endDate: new Date(YEAR, MONTH, 8),
  },
  {
    id: 6,
    title: '江苏紫金银行客户满意活动6',
    startDate: new Date(YEAR, MONTH, 21),
    endDate: new Date(YEAR, MONTH, 26),
  },
  {
    id: 7,
    title: '江苏紫金银行客户满意活动7',
    startDate: new Date(YEAR, MONTH, 8),
    endDate: new Date(YEAR, MONTH, 12),
  },
  {
    id: 8,
    title: '江苏紫金银行客户满意活动8',
    startDate: new Date(YEAR, PRE_MONTH, 29),
    endDate: new Date(YEAR, MONTH, 3),
  },
  {
    id: 9,
    title: '江苏紫金银行客户满意活动9',
    startDate: new Date(YEAR, MONTH, 29),
    endDate: new Date(YEAR, NEXT_MONTH, 4),
  },
];
@Component({
  templateUrl: './basic.component.html',
  changeDetection: ChangeDetectionStrategy.OnPush,
})
export class BaiscComponent {
  date: Date = DATE;
  events: LvCalendarEvents[] = Events;

  dateChange(date) {
    console.log('dateChange:', date);
  }

  activeDateChange(date) {
    console.log('activeDateChange:' + date.value.localDate);
  }
}
